Cannot import any portion of a fixed-width text file due to wrong format.
Cause:
The file to be imported does not meet the import requirements of Access 7.0. To import a fixed-width text file to an Access 7.0 database, each record in the file must be on a separate line, and all the records must contain the same number of characters. This is by design of Microsoft Access 7.0.
Solution:
Modify the text file to make sure that all records meet the requirements and then re-import the text file.
1) In the text file, make sure each record is on a different line.
2) Make sure each record contains the same number of characters.
3) Import the text file again:
a) If the destination database (the database to which to import a text file) is not already open, open the database.
b) If the Database window is not active, activate the Database window.
c) Select the 'File' menu and select 'Get External Data'. (A submenu appears.)
d) Select 'Import...' from the submenu. (The Import dialog box appears.)
e) Select 'Text Files (*.txt, *.csv, *.tab, *.asc)' from the 'Files of type' drop-down list.
f) Select the drive where the text file is located from the 'Look in' drop-down list.
g) Select the folder that contains the file from the 'Look in' list box. (The text file is displayed.)
NOTE: If the file is in a subfolder, continue selecting folders until the desired file is displayed.
h) Select the text file. (The file is highlighted.)
i) Click 'Import'. (The Text Import Wizard appears.)
Importing a text file
j) Select the 'Fixed Width' radio button.
the Fixed Width radio button
k) Click 'Next'.
l) Click on the desired place to separate fields in the text file. (A line with an arrow appears.)
m) Repeat Step 3)l) to insert arrow lines between every two fields.
Specifying text columns
NOTE: The size of a field can be adjusted by dragging the line. Each unit in the ruler in the middle of the dialog box stands for a character. Double-click on the line to remove it.
n) Click 'Next'.
o) Specify where the imported data is to be stored:
1] Select the 'In a New Table' radio button to store the data in a new table.
2] Select the 'In an Existing Table' radio button and select the table from the drop-down list next to the radio button.
NOTE: This option appends the data to an existing table. Select this option ONLY if the field names in the text file exactly match those in the existing table or if their column orders are the same.
Specifying the table to store the imported data
p) Click 'Next'.
q) If the data is stored in a new table, do the following:
1] (Optional) Customize fields in the text file:
Customizing fields
a] Select the field from the list box at the bottom of the 'Text Import Wizard' dialog box.
b] Do one or both of the following in the 'Field Options' group:
1} Change the name of the field in the 'Field Name' box.
2} Select one of the following indexing options from the 'Indexed' drop-down list:
a} Select 'No' to not index the field.
b} Select 'Yes (Duplicates OK)' to index the field and allow duplicates.
c} Select 'Yes (No duplicates)' to index the field without duplicates.
c] Select the 'Do not import field (Skip)' check box to not import the selected field.
2] Click 'Next'.
3] Do one of the following:
a] Select the 'Let Access add Primary Key' radio button to have Access set the primary key for the imported text file.
b] Select the 'Choose my own Primary Key' radio button and select the field to be used as the primary key from the drop-down list next to the radio button.
c] Select the 'No Primary Key' radio button to not set any primary key.
Setting the primary key
4] Click 'Next'.
r) Type the name of the new table in the 'Import to Table' box.
NOTE: If the 'In an Existing Table' radio button is selected in Step 14)a), the name of the existing table automatically displays in the box.
Typing a name for the table
s) Click 'Finish' to start the import process. (A message displays when the import is complete.)
t) Click 'OK' to close the Text Import Wizard.
u) Make sure the data types or other field properties assigned by Access are correct: